package com.lemon.blog.web.domain;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lemon.common.core.base.BaseEntity;
import com.lemon.common.core.serializer.JsonLongDeserializer;
import com.lemon.common.core.serializer.JsonLongSerializer;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * 包名称：com.lemon.blog.domain
 * 类名称：BlComment
 * 类描述：评论表
 * 创建人：@author huangpeng
 * 创建时间：2022年09月18日 19:47
 */
public class BlComment extends BaseEntity implements Serializable {
    /**
    * 评论id
    */
    @JsonSerialize(using = JsonLongSerializer.class)
    @JsonDeserialize(using = JsonLongDeserializer.class)
    private Long id;

    /**
    * 评价人id
    */
    @NotBlank(message = "评价人不能为空")
    private String userId;

    /**
    * 评论内容
    */
    @NotBlank(message = "评论内容不能为空")
    private String content;

    /**
    * 回复的用户的id
    */
    private String toUserId;

    /**
     * 管理员id
     */
    private String adminId;

    /**
    * 回复的帖子id
    */
    private String toBlogId;

    /**
    * 回复的评论id
    */
    private String toCommentId;

    /**
    * 点赞数
    */
    private Integer goodCount;

    /**
    * 评论来源，ABOUT_INFO: 关于，BLOG_INFO: 博客信息
    */
    private String source;

    /**
     * 博客标题-前端查询用
     */
    private String blogTitle;

    /**
     * 评论人用户昵称
     */
    private String nickName;

    /**
     * 被评论人用户昵称
     */
    private String toNickName;

    /**
     * 子评论
     */
    private List<BlComment> childCommentList;

    /**
     * 当前登录的用户id
     */
    private Long currUserId;

    /**
     * 当前用户信息-前端使用
     */
    private BiUser user;

    /**
     * 点赞状态-前端使用
     */
    private Integer dvLike;

    /**
     * 点踩状态-前端使用
     */
    private Integer dvDislike;

    /**
     * 点赞数量-前端使用
     */
    private Integer likeCount;

    /**
     * 点踩数量-前端使用
     */
    private Integer dislikeCount;

    /**
     * 回复数量-前端使用
     */
    private Integer replyCount;

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getAdminId() {
        return adminId;
    }

    public void setAdminId(String adminId) {
        this.adminId = adminId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getToUserId() {
        return toUserId;
    }

    public void setToUserId(String toUserId) {
        this.toUserId = toUserId;
    }

    public String getToBlogId() {
        return toBlogId;
    }

    public void setToBlogId(String toBlogId) {
        this.toBlogId = toBlogId;
    }

    public String getToCommentId() {
        return toCommentId;
    }

    public void setToCommentId(String toCommentId) {
        this.toCommentId = toCommentId;
    }

    public Integer getGoodCount() {
        return goodCount;
    }

    public void setGoodCount(Integer goodCount) {
        this.goodCount = goodCount;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getBlogTitle() {
        return blogTitle;
    }

    public void setBlogTitle(String blogTitle) {
        this.blogTitle = blogTitle;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getToNickName() {
        return toNickName;
    }

    public void setToNickName(String toNickName) {
        this.toNickName = toNickName;
    }

    public List<BlComment> getChildCommentList() {
        return childCommentList;
    }

    public void setChildCommentList(List<BlComment> childCommentList) {
        this.childCommentList = childCommentList;
    }

    public Long getCurrUserId() {
        return currUserId;
    }

    public void setCurrUserId(Long currUserId) {
        this.currUserId = currUserId;
    }

    public Integer getDvLike() {
        return dvLike;
    }

    public void setDvLike(Integer dvLike) {
        this.dvLike = dvLike;
    }

    public Integer getDvDislike() {
        return dvDislike;
    }

    public void setDvDislike(Integer dvDislike) {
        this.dvDislike = dvDislike;
    }

    public Integer getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(Integer likeCount) {
        this.likeCount = likeCount;
    }

    public Integer getDislikeCount() {
        return dislikeCount;
    }

    public void setDislikeCount(Integer dislikeCount) {
        this.dislikeCount = dislikeCount;
    }

    public Integer getReplyCount() {
        return replyCount;
    }

    public void setReplyCount(Integer replyCount) {
        this.replyCount = replyCount;
    }

    public BiUser getUser() {
        return user;
    }

    public void setUser(BiUser user) {
        this.user = user;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", content=").append(content);
        sb.append(", toUserId=").append(toUserId);
        sb.append(", toBlogId=").append(toBlogId);
        sb.append(", toCommentId=").append(toCommentId);
        sb.append(", goodCount=").append(goodCount);
        sb.append(", source=").append(source);
        sb.append("]");
        return sb.toString();
    }
}